﻿using Media.Controllers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace Media
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            config.Routes.MapHttpRoute(
                name: "GetMedia",
                routeTemplate: "{action}/{folder}/{fileName}",
                defaults: new { controller = "TN_CMSMedia" }
            );

            config.Routes.MapHttpRoute(
                name: "PostMedia",
                routeTemplate: "{action}/{folder}",
                defaults: new { controller = "TN_CMSMedia" }
            );

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
            
        }
    }
}
